* ===========================================================================*
*       Bureaucratic Gender Representation and Gender Mainstreaming in       *
*          International Organizations: Evidence from the World Bank         *
*        Authors: Mirko Heinzel, Catherine Weaver, Samantha Jorgensen        *
*                             Version: 5.3.2024                              *
*                                 Stata 16.2                                 *
* ===========================================================================*


*install packages if necessary
*ssc install reghdfe
*ssc install ppmlhdfe
*ssc install blindschemes
*ssc install ivreghdfe
*ssc install sum2docx
*ssc install psacalc
*ssc install plausexog
*ssc install estout

cd "location of files"

*******************
* Main Manuscript *
*******************

*---------*
* Figures *
*---------*

*Figure 1
use "Heinzel_Weaver_Jorgensen_24_APSR_project_data.dta", clear 

histogram overallscore, percent discrete xlabel(0(1)3) xtitle("Gender Mainstreaming Index") scheme(plotplain) ylabel(0(25)100)

*Figure 2
use "Heinzel_Weaver_Jorgensen_24_APSR_survey_data.dta", clear 

collapse (mean) eds ttls pms cds vps oth
rename * mean_*
gen id=1
reshape long mean_, i(id) j(val, string)

replace val="TTLs" if val=="ttls"
replace val="PMs" if val=="pms"
replace val="CDs" if val=="cds"
replace val="Other" if val=="oth"
replace val="VPs" if val=="vps"
replace val="EDs" if val=="eds"

gen value=1 if val=="TTLs"
replace value=2 if val=="CDs"
replace value=3 if val=="PMs"
replace value=4 if val=="VPs"
replace value=5 if val=="EDs"
replace value=6 if val=="Other"

labmask value , values(val)
rename mean_ percentage
replace percentage=percentage*100
graph hbar percentage , over(value) scheme(plotplainblind) ylabel(0(25)100) ytitle("Percentage of respondents")

*Figure 3
use "Heinzel_Weaver_Jorgensen_24_APSR_project_data.dta", clear 

collapse (mean) women_ttls women_cds women_pms, by(mjsector)
drop if mjsector=="NA"

label var women_ttls "Share of Women TTLs"
label var women_cds "Share of Women CDs"
label var women_pms "Share of Women PMs"

graph hbar women_ttls women_cds women_pms, over(mjsector) percent scheme(plotplainblind) ytitle("Percentage of staff") ylabel(0(25)100)

*Figure 4
use "Heinzel_Weaver_Jorgensen_24_APSR_survey_data.dta", clear 

reg approval i.us_board i.condi_high i.amount_high i.envisoc_yes i.gender_yes i.cpia_high i.mic i.macro [pw = weights_final] , vce(cluster respondent_id)
margins condi_high amount_high envisoc_yes gender_yes cpia_high mic macro us_board , atmeans post
eststo approval_model

reg impact i.us_board i.condi_high i.amount_high i.envisoc_yes i.gender_yes i.cpia_high i.mic i.macro [pw = weights_final] , vce(cluster respondent_id)
margins condi_high amount_high envisoc_yes gender_yes cpia_high mic macro us_board , atmeans post
eststo impact_model

coefplot approval_model , xtitle(Likelihood of project approval) scheme(plotplainblind) xlabel(5(1)8) keep(*gender_yes ) name(approval_graph, replace) 
coefplot impact_model , xtitle(Likelihood of project impact) scheme(plotplainblind) xlabel(5(1)8) keep(*gender_yes ) name(impact_graph, replace) 

graph combine approval_graph impact_graph, scheme(plotplainblind) rows(2)


*--------*
* Tables *
*--------*

*Table 1
use "Heinzel_Weaver_Jorgensen_24_APSR_project_data.dta", clear 

ebalance women_ttls gender_expertise women_cds women_pms gender_per ida log_amount post_conflict women_ministers principals_gender wecon girls_infant_mortality women_vulnerable_employment gdp_pc log_population 

reghdfe gender_informed women_ttls gender_expertise women_cds women_pms gender_per ida log_amount post_conflict women_ministers principals_gender wecon girls_infant_mortality women_vulnerable_employment gdp_pc log_population , absorb(cntry_fe sector_year) vce(cluster cntry_fe)
eststo m1

reghdfe overallscore women_ttls gender_expertise women_cds women_pms gender_per ida log_amount post_conflict women_ministers principals_gender wecon girls_infant_mortality women_vulnerable_employment gdp_pc log_population , absorb(cntry_fe sector_year) vce(cluster cntry_fe) 
eststo m2

reghdfe gender_informed women_ttls [pw = _webal] , absorb(cntry_fe sector_year) vce(cluster cntry_fe)
eststo m3

reghdfe overallscore women_ttls [pw = _webal] , absorb(cntry_fe sector_year) vce(cluster cntry_fe) 
eststo m4

ivreghdfe gender_informed gender_expertise women_cds women_pms gender_per ida log_amount post_conflict women_ministers principals_gender wecon girls_infant_mortality women_vulnerable_employment gdp_pc log_population (women_ttls=sum_ttlcount) , absorb(cntry_fe sector_year) cluster( cntry_fe)
eststo m5

ivreghdfe overallscore gender_expertise women_cds women_pms gender_per ida log_amount post_conflict women_ministers principals_gender wecon girls_infant_mortality women_vulnerable_employment gdp_pc log_population (women_ttls=sum_ttlcount), absorb(cntry_fe sector_year) cluster( cntry_fe)
eststo m6

estfe . m1 m2 m3 m4 m5 m6, labels(cntry_fe "Country fixed effects" sector_year "Sector-year fixed effects")

esttab m1 m2 m3 m4 m5 m6 using Table1.rtf, star(* 0.05 ** 0.01 *** 0.001) b(4) r2 se mlabels(,titles) l indicate(`r(indicate_fe)')

*Table 2
reghdfe gender_informed women_in_sector women_ttls gender_expertise women_cds women_pms gender_per ida log_amount post_conflict women_ministers principals_gender wecon girls_infant_mortality women_vulnerable_employment gdp_pc log_population c.meanscore_3_sector##c.meanscore_3_cntry, absorb(cntry_fe sector_fe approval_year) cluster(cntry_fe)
eststo m7

reghdfe overallscore women_in_sector women_ttls gender_expertise women_cds women_pms gender_per ida log_amount post_conflict women_ministers principals_gender wecon girls_infant_mortality women_vulnerable_employment gdp_pc log_population c.meanscore_3_sector##c.meanscore_3_cntry, absorb(cntry_fe sector_fe approval_year) cluster(cntry_fe)
eststo m8

estfe . m7 m8 , labels(cntry_fe "Country fixed effects" sector_year "Sector-year fixed effects")

esttab m7 m8 using Table2.rtf, star(* 0.05 ** 0.01 *** 0.001) b(4) r2 se mlabels(,titles) l indicate(`r(indicate_fe)')

*Table 3
use "Heinzel_Weaver_Jorgensen_24_APSR_survey_data.dta", clear 
*the output displays all possible marginal means differences. The two relevent coefficients are: 
// - gender_yes#women (0 1) vs (0 0) -> "Women vs. Men (Gender mainstreaming: No)"
// - gender_yes#women (1 1) vs (1 0) -> "Women vs. Men (Gender mainstreaming: Yes)"

*approval
reg approval i.condi_high i.amount_high i.envisoc_yes i.gender_yes##i.women i.cpia_high i.mic i.macro i.us_board [pw = weights_final] , vce(cluster respondent_id)
margins gender_yes##women, pwcompare(effects) atmeans ///
 cformat(%9.3f) sformat(%8.3f) pformat(%5.3f)
 
putdocx clear
putdocx begin
putdocx table pairwise = etable
putdocx save table3_approval.docx , replace

*impact
reg impact i.condi_high i.amount_high i.envisoc_yes i.gender_yes##i.women i.cpia_high i.mic i.macro i.us_board [pw = weights_final] , vce(cluster respondent_id)
margins gender_yes##women, pwcompare(effects) atmeans ///
 cformat(%9.3f) sformat(%8.3f) pformat(%5.3f)

putdocx clear
putdocx begin
putdocx table pairwise = etable
putdocx save table3_impact.docx , replace


************
* Appendix *
************

*---------*
* Figures *
*---------*

use "Heinzel_Weaver_Jorgensen_24_APSR_project_data.dta", clear 

*Figure A1
collapse (mean) dimension1analysiscode1yes dimension2actionscode1yes dimension3mecode1yes, by(approval_year)

drop if approval_year<2009
drop if approval_year>2017

graph twoway (line dimension1analysiscode1yes approval_year, plotregion(lcolor(gs10)) graphregion(color(white)) lpattern(solid) lcolor(black)) (line dimension2actionscode1yes approval_year, plotregion(lcolor(gs10)) graphregion(color(white)) lpattern(shortdash_dot) lcolor(black)) (line dimension3mecode1yes approval_year, plotregion(lcolor(gs10)) graphregion(color(white)) lpattern(shortdash) lcolor(black)) , legend(label(1 Analysis) label(2 Actions) label(3 Monitoring & Evaluation)) xlabel(2009(1)2017) ytitle("Share of Projects") ylabel(0(0.2)1)

*Figure A2
use "Heinzel_Weaver_Jorgensen_24_APSR_project_data.dta", clear 
graph bar overallscore if mjsector!="NA", over(mjsector) horizontal scheme(plotplainblind) ylabel(0(0.5)3)

*Figure A3
graph bar overallscore, over(regionname) horizontal scheme(plotplainblind) ylabel(0(0.5)3)

*Figure A4
graph bar overallscore , over(lendinginstrtype) horizontal scheme(plotplainblind) ylabel(0(0.5)3)

*Figure A5
graph bar totalamt , over(overallscore) horizontal scheme(plotplainblind) 

*--------*
* Tables *
*--------*

*Table A3
use "Heinzel_Weaver_Jorgensen_24_APSR_project_data.dta", clear 
sum2docx gender_informed overallscore women_ttls gender_expertise women_cds women_pms gender_per ida log_amount post_conflict women_ministers principals_gender wecon girls_infant_mortality women_vulnerable_employment gdp_pc log_population sum_ttlcount women_in_sector meanscore_3_sector meanscore_3_cntry using tableA3.docx if sample_desc==1, stats(N mean sd min max)

*Table A5
use "Heinzel_Weaver_Jorgensen_24_APSR_project_data.dta", clear 
tab2 (dimension1analysiscode1yes) (dimension2actionscode1yes) (dimension3mecode1yes) (overallscore)

*Table A6
reghdfe women_ttls sum_ttlcount gender_expertise women_cds women_pms gender_per ida log_amount post_conflict women_ministers principals_gender wecon girls_infant_mortality women_vulnerable_employment gdp_pc log_population if sample_desc==1, absorb(cntry_fe sector_year) cluster( cntry_fe)
eststo m1

estfe . m1 , labels(cntry_fe "Country fixed effects" sector_year "Sector-year fixed effects")

esttab m1 using TableA6.rtf, star(* 0.05 ** 0.01 *** 0.001) b(4) r2 se mlabels(,titles) l indicate(`r(indicate_fe)')

*Table A7
ppmlhdfe overallscore women_ttls gender_expertise women_cds women_pms gender_per ida log_amount post_conflict women_ministers principals_gender wecon girls_infant_mortality women_vulnerable_employment gdp_pc log_population , absorb(cntry_fe sector_year) vce(cluster cntry_fe) 
eststo m2

ppmlhdfe overallscore women_in_sector women_ttls gender_expertise women_cds women_pms gender_per ida log_amount post_conflict women_ministers principals_gender wecon girls_infant_mortality women_vulnerable_employment gdp_pc log_population c.meanscore_3_sector##c.meanscore_3_cntry, absorb(cntry_fe sector_fe approval_year) cluster(cntry_fe)
eststo m3

estfe . m2 m3 , labels(cntry_fe "Country fixed effects" sector_year "Sector-year fixed effects")

esttab m2 m3 using TableA7.rtf, star(* 0.05 ** 0.01 *** 0.001) b(4) pr2 se mlabels(,titles) l indicate(`r(indicate_fe)')

*Table A8
logit gender_informed women_ttls gender_expertise women_cds women_pms gender_per ida log_amount post_conflict women_ministers principals_gender wecon girls_infant_mortality women_vulnerable_employment gdp_pc log_population i.cntry_fe i.sector_year, vce(cluster cntry_fe)
eststo m4

ologit overallscore women_ttls gender_expertise women_cds women_pms gender_per ida log_amount post_conflict women_ministers principals_gender wecon girls_infant_mortality women_vulnerable_employment gdp_pc log_population i.cntry_fe i.sector_year, vce(cluster cntry_fe)
eststo m5

esttab m4 m5 using TableA8.rtf, star(* 0.05 ** 0.01 *** 0.001) b(4) pr2 se mlabels(,titles) l 

*Table A9
cmp setup

eststo m6: cmp (gender_informed = women_ttls gender_expertise women_cds women_pms gender_per ida log_amount post_conflict women_ministers principals_gender wecon girls_infant_mortality women_vulnerable_employment gdp_pc log_population i.cntry_fe i.sector_year) (overallscore_nozero = women_ttls gender_expertise women_cds women_pms gender_per ida log_amount post_conflict women_ministers principals_gender wecon girls_infant_mortality women_vulnerable_employment gdp_pc log_population i.cntry_fe i.sector_year) , indicators($cmp_probit $cmp_cont) iterate(50) difficult cl(cntry_fe)

eststo m7: cmp (gender_informed = women_ttls gender_expertise women_cds women_pms gender_per ida log_amount post_conflict i.cntry_year_fe i.sector_year) (overallscore_nozero = women_ttls gender_expertise women_cds women_pms gender_per ida log_amount post_conflict i.cntry_year_fe i.sector_year) , indicators($cmp_probit $cmp_cont) iterate(50) difficult cl(cntry_fe)

esttab m6 m7 using TableA9.rtf, star(* 0.05 ** 0.01 *** 0.001) b(4) pr2 se mlabels(,titles) l 

*Table A10
reghdfe gender_informed women_ttls gender_expertise women_cds women_pms gender_per ida log_amount post_conflict women_ministers principals_gender wecon girls_infant_mortality women_vulnerable_employment gdp_pc log_population , absorb(cntry_fe sector_year) vce(cluster cntry_year_fe)
eststo m8

reghdfe overallscore women_ttls gender_expertise women_cds women_pms gender_per ida log_amount post_conflict women_ministers principals_gender wecon girls_infant_mortality women_vulnerable_employment gdp_pc log_population , absorb(cntry_fe sector_year) vce(cluster cntry_year_fe) 
eststo m9

ivreghdfe gender_informed gender_expertise women_cds women_pms gender_per ida log_amount post_conflict women_ministers principals_gender wecon girls_infant_mortality women_vulnerable_employment gdp_pc log_population (women_ttls=sum_ttlcount) , absorb(cntry_fe sector_year) cluster( cntry_year_fe)
eststo m10

ivreghdfe overallscore gender_expertise women_cds women_pms gender_per ida log_amount post_conflict women_ministers principals_gender wecon girls_infant_mortality women_vulnerable_employment gdp_pc log_population (women_ttls=sum_ttlcount), absorb(cntry_fe sector_year) cluster( cntry_year_fe)
eststo m11

estfe . m8 m9 m10 m11 , labels(cntry_fe "Country fixed effects" sector_year "Sector-year fixed effects")

esttab m8 m9 m10 m11 using TableA10.rtf, star(* 0.05 ** 0.01 *** 0.001) b(4) r2 se mlabels(,titles) l indicate(`r(indicate_fe)')

*Table A11
reghdfe gender_informed women_ttls gender_expertise gender_per ida log_amount post_conflict women_ministers principals_gender wecon girls_infant_mortality women_vulnerable_employment gdp_pc log_population , absorb(cntry_fe sector_year) vce(cluster cntry_fe)
eststo m12

reghdfe overallscore women_ttls gender_expertise gender_per ida log_amount post_conflict women_ministers principals_gender wecon girls_infant_mortality women_vulnerable_employment gdp_pc log_population , absorb(cntry_fe sector_year) vce(cluster cntry_fe) 
eststo m13

reghdfe gender_informed women_cds gender_expertise gender_per ida log_amount post_conflict women_ministers principals_gender wecon girls_infant_mortality women_vulnerable_employment gdp_pc log_population , absorb(cntry_fe sector_year) vce(cluster cntry_fe)
eststo m14

reghdfe overallscore women_cds gender_expertise gender_per ida log_amount post_conflict women_ministers principals_gender wecon girls_infant_mortality women_vulnerable_employment gdp_pc log_population , absorb(cntry_fe sector_year) vce(cluster cntry_fe) 
eststo m15

reghdfe gender_informed women_pms gender_expertise gender_per ida log_amount post_conflict women_ministers principals_gender wecon girls_infant_mortality women_vulnerable_employment gdp_pc log_population , absorb(cntry_fe sector_year) vce(cluster cntry_fe)
eststo m16

reghdfe overallscore women_pms gender_expertise gender_per ida log_amount post_conflict women_ministers principals_gender wecon girls_infant_mortality women_vulnerable_employment gdp_pc log_population , absorb(cntry_fe sector_year) vce(cluster cntry_fe) 
eststo m17

estfe . m12 m13 m14 m15 m16 m17 , labels(cntry_fe "Country fixed effects" sector_year "Sector-year fixed effects")

esttab m12 m13 m14 m15 m16 m17 using TableA11.rtf, star(* 0.05 ** 0.01 *** 0.001) b(4) r2 se mlabels(,titles) l indicate(`r(indicate_fe)')

*Table A12
reghdfe gender_informed women_ttls gender_expertise women_cds women_pms gender_per ida log_amount post_conflict women_ministers principals_gender wecon girls_infant_mortality women_vulnerable_employment gdp_pc log_population fin_*, absorb(cntry_fe sector_year) vce(cluster cntry_fe)
eststo m18

reghdfe overallscore women_ttls gender_expertise women_cds women_pms gender_per ida log_amount post_conflict women_ministers principals_gender wecon girls_infant_mortality women_vulnerable_employment gdp_pc log_population fin_*, absorb(cntry_fe sector_year) vce(cluster cntry_fe) 
eststo m19

ivreghdfe gender_informed gender_expertise women_cds women_pms gender_per ida log_amount post_conflict women_ministers principals_gender wecon girls_infant_mortality women_vulnerable_employment gdp_pc log_population fin_* (women_ttls=sum_ttlcount) , absorb(cntry_fe sector_year) cluster( cntry_fe)
eststo m20

ivreghdfe overallscore gender_expertise women_cds women_pms gender_per ida log_amount post_conflict women_ministers principals_gender wecon girls_infant_mortality women_vulnerable_employment gdp_pc log_population fin_* (women_ttls=sum_ttlcount) , absorb(cntry_fe sector_year) cluster( cntry_fe)
eststo m21

estfe . m18 m19 m20 m21 , labels(cntry_fe "Country fixed effects" sector_year "Sector-year fixed effects")

esttab m18 m19 m20 m21 using TableA12.rtf, star(+ 0.1 * 0.05 ** 0.01 *** 0.001) b(4) r2 se mlabels(,titles) l indicate(`r(indicate_fe)')

*Table A13
reghdfe dimension3mecode1yes gender_target_bin women_ttls , absorb(cntry_fe sector_year) vce(cluster cntry_fe)
eststo m22

reghdfe dimension3mecode1yes gender_target_bin women_cds , absorb(cntry_fe sector_year) vce(cluster cntry_fe)
eststo m23

reghdfe dimension3mecode1yes gender_target_bin women_pms , absorb(cntry_fe sector_year) vce(cluster cntry_fe)
eststo m24

estfe . m22 m23 m24 , labels(cntry_fe "Country fixed effects" sector_year "Sector-year fixed effects")

esttab m22 m23 m24 using TableA13.rtf, star(+ 0.1 * 0.05 ** 0.01 *** 0.001) b(4) r2 se mlabels(,titles) l indicate(`r(indicate_fe)')

*Table A14
reghdfe wb_bank_all women_ttls , absorb(cntry_fe sector_year) vce(cluster cntry_fe)
eststo m25

reghdfe wb_bank_all women_ttls gender_expertise women_cds women_pms gender_per ida log_amount post_conflict women_ministers principals_gender wecon girls_infant_mortality women_vulnerable_employment gdp_pc log_population , absorb(cntry_fe sector_year) vce(cluster cntry_fe)
eststo m26

ivreghdfe wb_bank_all (women_ttls=sum_ttlcount), absorb(cntry_fe sector_year) cluster( cntry_fe)
eststo m27

ivreghdfe wb_bank_all gender_expertise women_cds women_pms gender_per ida log_amount post_conflict women_ministers principals_gender wecon girls_infant_mortality women_vulnerable_employment gdp_pc log_population (women_ttls=sum_ttlcount), absorb(cntry_fe sector_year) cluster( cntry_fe)
eststo m28

estfe . m25 m26 m27 m28 , labels(cntry_fe "Country fixed effects" sector_year "Sector-year fixed effects")

esttab m25 m26 m27 m28 using TableA14.rtf, star(* 0.05 ** 0.01 *** 0.001) b(4) r2 se mlabels(,titles) l indicate(`r(indicate_fe)')

*Table A15
reghdfe gender_informed women_ttls gender_expertise women_cds women_pms ida log_amount post_conflict women_ministers principals_gender wecon girls_infant_mortality women_vulnerable_employment gdp_pc log_population, absorb(cntry_fe sector_year) vce(cluster cntry_fe)
eststo m29

reghdfe overallscore women_ttls gender_expertise women_cds women_pms ida log_amount post_conflict women_ministers principals_gender wecon girls_infant_mortality women_vulnerable_employment gdp_pc log_population , absorb(cntry_fe sector_year) vce(cluster cntry_fe) 
eststo m30

reghdfe gender_informed women_ttls gender_expertise women_cds women_pms ida log_amount post_conflict women_ministers principals_gender wecon girls_infant_mortality women_vulnerable_employment gdp_pc log_population if gender_per==0, absorb(cntry_fe sector_year) vce(cluster cntry_fe)
eststo m31

reghdfe overallscore women_ttls gender_expertise women_cds women_pms ida log_amount post_conflict women_ministers principals_gender wecon girls_infant_mortality women_vulnerable_employment gdp_pc log_population if gender_per==0, absorb(cntry_fe sector_year) vce(cluster cntry_fe) 
eststo m32

estfe . m29 m30 m31 m32 ,labels(cntry_fe "Country fixed effects" sector_year "Sector-year fixed effects")

esttab m29 m30 m31 m32 using TableA15.rtf, star(+ 0.1 * 0.05 ** 0.01 *** 0.001) b(4) r2 se mlabels(,titles) l indicate(`r(indicate_fe)')

*Table A16
reghdfe gender_informed women_ttls##women_cds gender_expertise women_pms gender_per ida log_amount post_conflict women_ministers principals_gender wecon girls_infant_mortality women_vulnerable_employment gdp_pc log_population , absorb(cntry_fe sector_year) vce(cluster cntry_fe)
eststo m33

reghdfe overallscore women_ttls##women_cds gender_expertise women_pms gender_per ida log_amount post_conflict women_ministers principals_gender wecon girls_infant_mortality women_vulnerable_employment gdp_pc log_population , absorb(cntry_fe sector_year) vce(cluster cntry_fe) 
eststo m34

reghdfe gender_informed women_ttls##c. gender_expertise_bin women_cds women_pms gender_per ida log_amount post_conflict women_ministers principals_gender wecon girls_infant_mortality women_vulnerable_employment gdp_pc log_population , absorb(cntry_fe sector_year) vce(cluster cntry_fe) 
eststo m35

reghdfe overallscore women_ttls##c. gender_expertise_bin women_cds women_pms gender_per ida log_amount post_conflict women_ministers principals_gender wecon girls_infant_mortality women_vulnerable_employment gdp_pc log_population , absorb(cntry_fe sector_year) vce(cluster cntry_fe) 
eststo m36

estfe . m33 m34 m35 m36 , labels(cntry_fe "Country fixed effects" sector_year "Sector-year fixed effects")

esttab m33 m34 m35 m36 using TableA16.rtf, star(+ 0.1 * 0.05 ** 0.01 *** 0.001) b(4) r2 se mlabels(,titles) l indicate(`r(indicate_fe)')


*Table A17
use "Heinzel_Weaver_Jorgensen_24_APSR_survey_data.dta", clear 

reg approval gender_yes condi_high amount_high envisoc_yes macro cpia_high us_board mic [pw = weights_final] , vce(cluster respondent_id)
eststo m37

reg impact gender_yes us_board condi_high amount_high envisoc_yes macro cpia_high mic [pw = weights_final] , vce(cluster respondent_id)
eststo m38

esttab m37 m38 using TableA17.rtf, star(* 0.05 ** 0.01 *** 0.001) b(4) r2 se mlabels(,titles) l indicate(`r(indicate_fe)')

*Table A18
reg impact i.condi_high i.amount_high i.envisoc_yes i.gender_yes##i.women i.cpia_high i.mic i.macro i.us_board i.sector [pw = weights_final] , vce(cluster respondent_id)
margins gender_yes##women, pwcompare(effects) atmeans ///
 cformat(%9.3f) sformat(%8.3f) pformat(%5.3f)

putdocx clear
putdocx begin
putdocx table pairwise = etable
putdocx save TableA18_impact.docx , replace

reg approval i.condi_high i.amount_high i.envisoc_yes i.gender_yes##i.women i.cpia_high i.mic i.macro i.us_board i.sector [pw = weights_final] , vce(cluster respondent_id)
margins gender_yes##women, pwcompare(effects) atmeans ///
 cformat(%9.3f) sformat(%8.3f) pformat(%5.3f)

putdocx clear
putdocx begin
putdocx table pairwise = etable
putdocx save TableA18_approval.docx , replace

*Table A19
sort respondent_id
quietly by respondent_id: gen dup = cond(_N==1,0,_n)

reghdfe gender_expertise women if dup<2, noabsorb
eststo m41

reghdfe gender_expertise women if dup<2, absorb(sector) 
eststo m42

reghdfe gender_expertise women if dup<2, absorb(sector region) 
eststo m43

reghdfe gender_expertise women if dup<2, absorb(sector region education) 
eststo m44

reghdfe gender_expertise women if dup<2, absorb(sector region education nationality) 
eststo m45

estfe . m41 m42 m43 m44 m45 , labels(sector "Sector fixed effects" region "Region fixed effects" Q7 "Degree fixed effects" country_ttl_data "Nationality fixed effects")

esttab m41 m42 m43 m44 m45 using TableA19.rtf, star(* 0.05 ** 0.01 *** 0.001) b(4) r2 se mlabels(,titles) l indicate(`r(indicate_fe)')

*Table A20
reg impact i.condi_high i.amount_high i.envisoc_yes i.gender_yes##i.women i.cpia_high i.mic i.macro i.us_board i.gender_expertise [pw = weights_final] , vce(cluster respondent_id)
margins gender_yes##women, pwcompare(effects) atmeans ///
 cformat(%9.3f) sformat(%8.3f) pformat(%5.3f)

putdocx clear
putdocx begin
putdocx table pairwise = etable
putdocx save TableA20_impact.docx , replace

reg approval i.condi_high i.amount_high i.envisoc_yes i.gender_yes##i.women i.cpia_high i.mic i.macro i.us_board i.gender_expertise [pw = weights_final] , vce(cluster respondent_id)
margins gender_yes##women, pwcompare(effects) atmeans ///
 cformat(%9.3f) sformat(%8.3f) pformat(%5.3f)

putdocx clear
putdocx begin
putdocx table pairwise = etable
putdocx save TableA20_approval.docx , replace

*Table A21
reg impact i.condi_high i.amount_high i.envisoc_yes i.gender_yes##i.gender_high i.cpia_high i.mic i.macro i.us_board [pw = weights_final] , vce(cluster respondent_id)
margins gender_yes##gender_high, pwcompare(effects) atmeans ///
 cformat(%9.3f) sformat(%8.3f) pformat(%5.3f)

putdocx clear
putdocx begin
putdocx table pairwise = etable
putdocx save TableA21_impact.docx , replace
	  
reg approval i.condi_high i.amount_high i.envisoc_yes i.gender_yes##i.gender_high i.cpia_high i.mic i.macro i.us_board [pw = weights_final] , vce(cluster respondent_id)
margins gender_yes##gender_high, pwcompare(effects) atmeans ///
 cformat(%9.3f) sformat(%8.3f) pformat(%5.3f)

putdocx clear
putdocx begin
putdocx table pairwise = etable
putdocx save TableA21_approval.docx , replace

*Table A22
reg impact i.condi_high i.amount_high i.envisoc_yes i.gender_yes##i.women i.cpia_high i.mic i.macro i.us_board [pw = weights_gender] , vce(cluster respondent_id)
margins gender_yes##women, pwcompare(effects) atmeans ///
 cformat(%9.3f) sformat(%8.3f) pformat(%5.3f)

putdocx clear
putdocx begin
putdocx table pairwise = etable
putdocx save TableA22_impact.docx , replace

reg approval i.condi_high i.amount_high i.envisoc_yes i.gender_yes##i.women i.cpia_high i.mic i.macro i.us_board [pw = weights_gender] , vce(cluster respondent_id)
margins gender_yes##women, pwcompare(effects) atmeans ///
 cformat(%9.3f) sformat(%8.3f) pformat(%5.3f)

putdocx clear
putdocx begin
putdocx table pairwise = etable
putdocx save TableA22_approval.docx , replace
	
*Table A23
reg impact i.condi_high i.amount_high i.envisoc_yes i.gender_yes##i.women i.cpia_high i.mic i.macro i.us_board [pw = weights_genderedu] , vce(cluster respondent_id)
margins gender_yes##women, pwcompare(effects) atmeans ///
 cformat(%9.3f) sformat(%8.3f) pformat(%5.3f)

putdocx clear
putdocx begin
putdocx table pairwise = etable
putdocx save TableA23_impact.docx , replace
 
reg approval i.condi_high i.amount_high i.envisoc_yes i.gender_yes##i.women i.cpia_high i.mic i.macro i.us_board [pw = weights_genderedu] , vce(cluster respondent_id)
margins gender_yes##women, pwcompare(effects) atmeans ///
 cformat(%9.3f) sformat(%8.3f) pformat(%5.3f)

putdocx clear
putdocx begin
putdocx table pairwise = etable
putdocx save TableA23_approval.docx , replace

*Table A24
reg impact i.condi_high i.amount_high i.envisoc_yes i.gender_yes##i.women i.cpia_high i.mic i.macro i.us_board [pw = weights_gendernat] , vce(cluster respondent_id)
margins gender_yes##women, pwcompare(effects) atmeans ///
 cformat(%9.3f) sformat(%8.3f) pformat(%5.3f)

putdocx clear
putdocx begin
putdocx table pairwise = etable
putdocx save TableA24_impact.docx , replace
	 
reg approval i.condi_high i.amount_high i.envisoc_yes i.gender_yes##i.women i.cpia_high i.mic i.macro i.us_board [pw = weights_gendernat] , vce(cluster respondent_id)
margins gender_yes##women, pwcompare(effects) atmeans ///
 cformat(%9.3f) sformat(%8.3f) pformat(%5.3f)

putdocx clear
putdocx begin
putdocx table pairwise = etable
putdocx save TableA24_approval.docx , replace
